//
//  OrderDetailCell.m
//  StarOrangeStaff
//
//  Created by lshenrong on 2020/7/19.
//  Copyright © 2020 lshenrong. All rights reserved.
//

#import "OrderDetailCell.h"

@interface OrderDetailCell ()

@property (nonatomic,strong) UIView *settingBackgroundView;
@property (nonatomic,strong) UILabel *titleLbl;
@property (nonatomic,strong) UIImageView *titleImgView;


@property (nonatomic,strong) UILabel *title_orderNumLbl;
@property (nonatomic,strong) UILabel *title_carTypeLbl;
@property (nonatomic,strong) UILabel *title_carNumLbl;
@property (nonatomic,strong) UILabel *title_seatNumLbl;
@property (nonatomic,strong) UILabel *title_beginTimeLbl;
@property (nonatomic,strong) UILabel *title_orderDayLbl;
@property (nonatomic,strong) UILabel *title_endTimeLbl;
@property (nonatomic,strong) UILabel *title_originAddressLbl;
@property (nonatomic,strong) UILabel *title_tripLbl;
@property (nonatomic,strong) UILabel *title_rentType;
@property (nonatomic,strong) UILabel *title_orderUnitLbl;
@property (nonatomic,strong) UILabel *title_contactLbl;
@property (nonatomic,strong) UILabel *title_contackNumLbl;
@property (nonatomic,strong) UILabel *title_dispatcherLbl;


@property (nonatomic,strong) UILabel *orderNumLbl;
@property (nonatomic,strong) UILabel *carTypeLbl;
@property (nonatomic,strong) UILabel *carNumLbl;
@property (nonatomic,strong) UILabel *seatNumLbl;
@property (nonatomic,strong) UILabel *beginTimeLbl;
@property (nonatomic,strong) UILabel *orderDayLbl;
@property (nonatomic,strong) UILabel *endTimeLbl;
@property (nonatomic,strong) UILabel *originAddressLbl;
@property (nonatomic,strong) UILabel *tripLbl;
@property (nonatomic,strong) UILabel *rentType;
@property (nonatomic,strong) UILabel *orderUnitLbl;
@property (nonatomic,strong) UILabel *contactLbl;
@property (nonatomic,strong) UILabel *contackNumLbl;
@property (nonatomic,strong) UILabel *dispatcherLbl;

@end

@implementation OrderDetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self != nil ){
        self.contentView.backgroundColor = kAppBackgoundColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        UIView *lineView = [UIView lineView];
              lineView.backgroundColor = kSeparateLineColor;//
    
        [self.contentView addSubview:self.settingBackgroundView];
        [self.settingBackgroundView addSubview:lineView];
        [self.settingBackgroundView addSubview:self.titleImgView];
        [self.settingBackgroundView addSubview:self.titleLbl];
        
        [self.settingBackgroundView addSubview:self.title_orderNumLbl];
        [self.settingBackgroundView addSubview:self.title_carTypeLbl];
        [self.settingBackgroundView addSubview:self.title_carNumLbl];
        [self.settingBackgroundView addSubview:self.title_seatNumLbl];
        [self.settingBackgroundView addSubview:self.title_beginTimeLbl];
        [self.settingBackgroundView addSubview:self.title_orderDayLbl];
        [self.settingBackgroundView addSubview:self.title_endTimeLbl];
        [self.settingBackgroundView addSubview:self.title_originAddressLbl];
        [self.settingBackgroundView addSubview:self.title_tripLbl];
        [self.settingBackgroundView addSubview:self.title_rentType];
        [self.settingBackgroundView addSubview:self.title_orderUnitLbl];
        [self.settingBackgroundView addSubview:self.title_contactLbl];
        [self.settingBackgroundView addSubview:self.title_contactLbl];
        [self.settingBackgroundView addSubview:self.title_contackNumLbl];
        [self.settingBackgroundView addSubview:self.title_dispatcherLbl];

        
        [self.settingBackgroundView addSubview:self.orderNumLbl];
        [self.settingBackgroundView addSubview:self.carTypeLbl];
        [self.settingBackgroundView addSubview:self.carNumLbl];
        [self.settingBackgroundView addSubview:self.seatNumLbl];
        [self.settingBackgroundView addSubview:self.beginTimeLbl];
        [self.settingBackgroundView addSubview:self.orderDayLbl];
        [self.settingBackgroundView addSubview:self.endTimeLbl];
        [self.settingBackgroundView addSubview:self.originAddressLbl];
        [self.settingBackgroundView addSubview:self.tripLbl];
        [self.settingBackgroundView addSubview:self.rentType];
        [self.settingBackgroundView addSubview:self.orderUnitLbl];
        [self.settingBackgroundView addSubview:self.contactLbl];
        [self.settingBackgroundView addSubview:self.contactLbl];
        [self.settingBackgroundView addSubview:self.contackNumLbl];
        [self.settingBackgroundView addSubview:self.dispatcherLbl];





        [self.settingBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
               make.left.mas_equalTo(self.contentView).mas_offset(kMarginOffsetX);
               make.right.mas_equalTo(self.contentView).mas_offset(-kMarginOffsetX);
               make.top.mas_equalTo(self.contentView).mas_offset(0);
               make.bottom.mas_equalTo(self.contentView).mas_offset(0);
        }];
        
        [self.titleImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.settingBackgroundView).mas_offset(kMarginOffsetX);
            make.top.mas_equalTo(self.settingBackgroundView).mas_offset(kMarginOffsetX);
            make.width.mas_equalTo(21);
            make.height.mas_equalTo(18);
        }];
        
        [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.titleImgView.mas_centerY);

        }];
        
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
               make.left.mas_equalTo(self.settingBackgroundView).mas_offset(kMarginOffsetX);
               make.right.mas_equalTo(self.settingBackgroundView).mas_offset(-kMarginOffsetX);
               make.top.mas_equalTo(50);
               make.height.mas_offset(0.5);
        }];
        
        [self.title_orderNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(lineView.mas_bottom).mas_offset(10);
            make.width.mas_offset(70);
        }];
        
        [self.orderNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_orderNumLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_orderNumLbl.mas_centerY);
        }];
        
        
        [self.title_carTypeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.orderNumLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.carTypeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_carTypeLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_carTypeLbl.mas_centerY);
        }];
        
        [self.title_carNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.carTypeLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.carNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_carNumLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_carNumLbl.mas_centerY);
        }];
        
        
        [self.title_seatNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.carNumLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.seatNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_seatNumLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_seatNumLbl.mas_centerY);
        }];
        
        [self.title_beginTimeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.seatNumLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.beginTimeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_beginTimeLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_beginTimeLbl.mas_centerY);
        }];
        
        [self.title_orderDayLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.beginTimeLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.orderDayLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_orderDayLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_orderDayLbl.mas_centerY);
        }];
        
        
        [self.title_endTimeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.orderDayLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.endTimeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_endTimeLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_endTimeLbl.mas_centerY);
        }];
        
        [self.title_originAddressLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.endTimeLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.originAddressLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_originAddressLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_originAddressLbl.mas_centerY);
        }];
        
        [self.title_tripLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.originAddressLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.tripLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_tripLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_tripLbl.mas_centerY);
        }];
        
        [self.title_rentType mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.tripLbl.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.rentType mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_rentType.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_rentType.mas_centerY);
        }];
        
        [self.title_orderUnitLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.rentType.mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.orderUnitLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_orderUnitLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_orderUnitLbl.mas_centerY);
        }];
        
        [self.title_contactLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.orderUnitLbl .mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.contactLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_contactLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_contactLbl.mas_centerY);
        }];
        
        [self.title_contackNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.contactLbl .mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.contackNumLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_contackNumLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_contackNumLbl.mas_centerY);
        }];
        
        
        [self.title_dispatcherLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleImgView.mas_right);
            make.top.mas_equalTo(self.contackNumLbl .mas_bottom).mas_offset(kMarginOffsetX);
            make.width.mas_offset(70);
        }];
        
        [self.dispatcherLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.title_dispatcherLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.title_dispatcherLbl.mas_centerY);
        }];
        
    }
    return self;
}

- (UIView *)settingBackgroundView{
    if (!_settingBackgroundView) {
        _settingBackgroundView = [[UIView alloc]init];
        _settingBackgroundView.backgroundColor = [UIColor whiteColor];
        _settingBackgroundView.layer.cornerRadius = 4;
        _settingBackgroundView.clipsToBounds = YES;
    }
    return _settingBackgroundView;
}

MACRO_UIImageView(titleImgView, @"order_company")
MACRO_UILabel_LazyloadWithPFCGFont(titleLbl, @"订单详情", kBlackColor, 15)


MACRO_UILabel_LazyloadWithPFCGFont(title_orderNumLbl, @"订单编号", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_carTypeLbl, @"用车类型", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_carNumLbl, @"用车数量", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_seatNumLbl, @"座位数", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_beginTimeLbl, @"开始时间", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_orderDayLbl, @"订车天数", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_endTimeLbl, @"结束时间", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_originAddressLbl, @"出发地", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_tripLbl, @"行程", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_rentType, @"租赁方式", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_orderUnitLbl, @"用车单位", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_contactLbl, @"联系人", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_contackNumLbl, @"联系方式", kLightBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(title_dispatcherLbl, @"调度员", kLightBlackColor, 14)


MACRO_UILabel_LazyloadWithPFCGFont(orderNumLbl, @"订单编号", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(carTypeLbl, @"用车类型", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(carNumLbl, @"用车数量", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(seatNumLbl, @"座位数", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(beginTimeLbl, @"开始时间", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(orderDayLbl, @"订车天数", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(endTimeLbl, @"结束时间", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(originAddressLbl, @"出发地", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(tripLbl, @"行程", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(rentType, @"租赁方式", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(orderUnitLbl, @"用车单位", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(contactLbl, @"联系人", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(contackNumLbl, @"联系方式", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(dispatcherLbl, @"调度员", kBlackColor, 15)





@end
